The present invention relates to the technique of collating an image obtained by shooting a predetermined subject with a model image registered in advance to confirm the subject. Particularly, the present invention relates to a processing method and apparatus to register a model image in the apparatus prior to the confirmation process.
In the conventional registration process of a model image, the image obtained by shooting a model of an object to be confirmed is displayed on a monitor. The operator specifies an image region that is to be cut out as the model image on the display screen.
In the case where the object to be subjected to the confirmation process has a predetermined pattern, an image region including that pattern and the background area is set. Image data within that region is registered as the model image. In the confirmation process, a correlation operation of the density difference for each corresponding pixel is carried out between the image to be processed and the model image, and the similarity of the pattern found in the two images is obtained for the determination of whether there is a pattern or not and whether the pattern to be confirmed is good or not.
When an image that has small difference in density such as an image in which the ratio of the pattern to the background area is small or an image in which a pattern of uniform density (solid painted pattern) occupies the major area as the model image in this type of confirmation process, the qualification of obtaining a high correlation value for the model image is extremely milder than the case where an image having great difference in density is set as the model image. Therefore, there is a possibility of erroneous confirmation of the pattern even with a small noise on the image when difference in the density is small in the model image. The reliability of the confirmation result will be degraded significantly.
In order to obtain a confirmation result of high accuracy in this type of confirmation process, a model image that has the maximum difference in density should be set.
However, the model image set by the operator""s personal view does not necessarily have the appropriate condition. There are many cases where significant error has occurred in the confirmation process due to the improper setting of the model image.
The applicant has proposed a method including the steps of calculating an evaluation value representing the quality of the image in each of an image region to cut out a model image while modifying the size thereof and the like, and employing the image data in the image region corresponding to a desired evaluation value as the model image (Japanese Patent Laying-Open No. 9-128536).
In the above method, a monitor is required for the operator to specify the image region to be cut out, as well as a display control mechanism to display the image and the specified result of the image region on the monitor. The cost for introducing the apparatus is increased and the apparatus scale will become larger. There was a problem that it is unsuitable to install at the testing line and the like of a factory.
The present invention is directed to the above problem. An object is to support the registration process of a model image, and registering an appropriate model image using that support method in order to allow an appropriate model image to be registered simply without having to display the image through a monitor.
An image processing apparatus of the present invention includes an image sensing apparatus generating image data including a plurality of pixels, each pixel including level data, by shooting a subject; an evaluation value calculator calculating an evaluation value representing the appropriateness of using image data included in a registration region defined as the entire or partial of an image sensed region represented by the image data generated by the image sensing apparatus as the test criterion; a casing accommodating at least the image sensing apparatus or the evaluation value calculator; a display provided at the casing to sequentially display a series of calculated evaluation values when the image sensing apparatus shoots a subject repeatedly; and a registration designator for entering designation by the operator that the image data included in the registration region is to be registered as the test criterion.
According to the image processing apparatus of the present invention, the operator can alter the relative position between the image sensing apparatus and the subject to be shot while viewing the level of the evaluation value displayed at the display to input designation to the registration designator when the evaluation value attains a desired value (the appropriateness level is increased), so that image data with high appropriateness as the test criterion can be identified. The evaluation value may take a greater value or a smaller value as the appropriateness for the test criterion becomes greater depending upon the calculation method and the testing system. For example, in the case where the dispersion value of the level data of the pixel included in the registration region is set as the evaluation value, the appropriateness becomes greater as the evaluation value becomes larger when testing is carried out on the basis of the match of the pattern on the subject. In this case, the operator enters designation to the registration designator when the evaluation value takes a large value. In contrast, the appropriateness is greater as the evaluation value becomes smaller in the case where the test indicates xe2x80x9cpassxe2x80x9d when the region subjected to the test on the subject is plain. The magnitude relationship of the evaluation value can be inverted depending upon the equation for calculating the evaluation value.
The level data included by the pixel forming the image data may be a value representing the light received amount of that pixel. Also, the level data may be one of the parameters representing the color of that pixel. The level data of the pixel is also referred to as xe2x80x9cdensityxe2x80x9d.
When the registration region is a portion of the image sensed region, the registration region can be defined as the region on an image memory in which the image data generated by the image sensing apparatus is stored. Alternatively, the registration region can be defined at a timing region by the signal timing of the image data sequentially transmitted from the image sensing apparatus.
One or both of the image sensing apparatus and the evaluation value calculator can be accommodated in the casing. In the case where the image sensing apparatus is stored in the casing, the operator can easily adjust the relative position between the image sensing apparatus and the image sensed subject while viewing the display since the display is provided at the casing. In this case, the evaluation value calculator can be stored in the casing. Alternatively, the evaluation value can be obtained from an evaluation value calculator provided outside the casing for display. When the evaluation value calculator is stored in the casing and the image sensing apparatus is provided outside the casing, the adjustment operation is facilitated by installing the casing so that the operator that adjusts the position of the image sensing apparatus can visually confirm the display provided in the casing.
As to the sequential display of an evaluation value by the display, the evaluation value can be displayed for every image data generated by the image sensing apparatus. Alternatively, the evaluation value can be displayed corresponding to a portion of the image data such as displaying an evaluation value once for every several times of generation of the image data. The registration designator is preferably a switch such as a depression button that can be manipulated by the operator. Registration designation is also referred to as xe2x80x9cteachingxe2x80x9d. The input applied to the registration designator functions as the designation to register the current image data included in the registration region as the test criterion. The image data that becomes the subject of registration by this designation can be stored in the image processing apparatus. Alternatively, this designation and the image data set as the subject of registration by this designation can be provided outside the image processing apparatus and have the subsequent process carried out by another apparatus. The image data that is set as the subject of registration by this designation is stored inside or outside the image processing apparatus to be compared with another set of image data obtained by shooting a subject of testing.
The evaluation value indicating the appropriateness as the test criterion is preferably the level of variation of the level data belonging to the pixel included in the registration region. The evaluation value is typically the dispersion value of the level data.
The display can provide the evaluation value in numerics or in the form of a graph. The operator can identify the magnitude of the evaluation value more quickly when displayed in the graphical format. Particularly, display in the bar graph formed is preferable.
The image sensing apparatus further includes a projector for projecting an image indicating the range of the registration region on a subject. The operation of registering the test criterion is more facilitated since the operator can confirm the range of the registration region on the subject by the projected image. A projector that projects an image indicating the range of an image sensing region can be provided instead of the projector that projects an image indicating the range of the registration region. The operator can identify the rough range of the registration region on the subject by the projected image according to the relationship with the range of the image sensing region. It is needless to say that the operator can estimate the range of the registration region by the position relationship between the camera that functions as the image sensing apparatus and the subject even when an image is not projected on the subject.
The image processing apparatus of the present invention can include the function as a test apparatus by including a test criterion data memory storing image data included in the registration region when designation is input to the registration designator as the test criterion, a match level calculator calculating the match between the image data generated from the image sensing apparatus and the stored test criterion data, and a determinator providing the determination result of whether the match level is greater than a predetermined threshold value.
In a preferable embodiment of the present invention, the display provides the evaluation value when image data is to be registered as the test criterion and the value indicating the match when the match level is calculated. Since the evaluation value and the match level will not be displayed at the same time, the apparatus can be reduced in size by switching between these displays with the same display.
A registration method of a test criterion image of the present invention includes the steps of repeatedly shooting a subject to obtain a series of image data by an image sensing apparatus that generates image data including a plurality of pixels, each pixel including level data, by shooting a subject; sequentially calculating, according to the repetitive shooting, an evaluation value representing the appropriateness of using the image data included in a registration region defined as the entire or a portion of the image sensing region represented by the image data generated by the image sensing apparatus as the test criterion; adjusting the relative position between the image sensing apparatus and the subject while referring to the evaluation value; and storing as the test criterion the image data included in the registration region when the evaluation value attains a desired value.
In the preferable embodiment of the present invention, the calculated evaluation value is sequentially displayed so that the operator can adjust the relative position between the image sensing apparatus and the subject while referring to the displayed evaluation value. Also, the image sensing apparatus or the subject can be attached to a moving device such as a robot arm to have the relative position between the image sensing apparatus and the subject adjusted by controlling the moving device according to the process of a computer program so that the evaluation value attains a desired value such as a value larger than or smaller than a predetermined threshold value, or a maximal value or minimum value.
In the preferable embodiment of the present invention, the image data included in the registration region can be stored as the test criterion in response to designation by the operator when the operator determines that the evaluation value has attained a desired value. In the determination of whether the evaluation value has attained the desired value or not, the operator does not necessarily have to carry out determination on the basis of comparison with a predetermined threshold value. The operator can provide designation when a relatively large or small evaluation value has been obtained in that state. The operator can also provide designation taking into account which portion on the subject the image is to be registered in addition to the magnitude of the evaluation value. The determination can be made, not by the operator, but by a computer program process. Designation can be provided when the evaluation value attains a desired value, for example, attains a value larger than or smaller than a predetermined threshold value, or attains the maximal value or the minimum value.